package com.htime.domain;

import java.io.Serializable;
import java.util.Date;

/**
 * Created by HTime on 2017/3/5.
 */
public class CommonRes  implements Serializable {

    private static final long serialVersionUID = 6094615237599920640L;

    final static public int RES_OK 					= 0 ;
    final static public int RES_UNKNOW_ERROR 		= 1000 ;
    final static public int RES_UNSUPPORT 			= 1001 ;
    final static public int RES_INVALID_PARAM 		= 1002 ;
    final static public int RES_DAOEXCEPTION 		= 1003 ;
    final static public int RES_RUNTIME_EXCEPTION 	= 1004 ;
    final static public int RES_NO_RIGHT 			= 1005 ;
    final static public int RES_NEED_SIGNIN 		= 1006 ;
    final static public int RES_AUTH_FAILED 		= 1007 ;
    final static public int RES_INVALID_TOKEN 		= 1008 ;
    final static public int RES_NEED_AUTH 			= 1009 ;
    final static public int RES_TIMEOUT 			= 1010 ;
    final static public int RES_NOT_ALLOW 			= 1011 ;

    private Integer rc = RES_OK;
    private String msgInfo;			//client show info tip
    private String errorInfo ; 		//client show error tip
    private String redirect ; 		//the redirected api server
    private String redirectSign ; 	// the the signture of redirect
    private Integer ccdVersion ; 	// the client configure data version ;
    private String requestUrl;      // request url
    private Date serverTime ; 		//the server current system time

    public static CommonRes retOK() {
        return new CommonRes();
    }

    public void setError(int errorType, String errorInfo) {
        this.rc=errorType;
        this.errorInfo=errorInfo;
    }

    public static CommonRes retError(int errorType,String errorInfo) {
        CommonRes commonRes= new CommonRes();
        commonRes.rc=errorType;
        commonRes.errorInfo=errorInfo;
        return commonRes;
    }

    public Integer getRc() {
        return rc;
    }

    public void setRc(Integer rc) {
        this.rc = rc;
    }

    public String getRequestUrl() {
        return requestUrl;
    }

    public void setRequestUrl(String requestUrl) {
        this.requestUrl = requestUrl;
    }

    public String getMsgInfo() {
        return msgInfo;
    }

    public void setMsgInfo(String msgInfo) {
        this.msgInfo = msgInfo;
    }

    public String getErrorInfo() {
        return errorInfo;
    }

    public void setErrorInfo(String errorInfo) {
        this.errorInfo = errorInfo;
    }

    public String getRedirect() {
        return redirect;
    }

    public void setRedirect(String redirect) {
        this.redirect = redirect;
    }

    public String getRedirectSign() {
        return redirectSign;
    }

    public void setRedirectSign(String redirectSign) {
        this.redirectSign = redirectSign;
    }

    public Integer getCcdVersion() {
        return ccdVersion;
    }

    public void setCcdVersion(Integer ccdVersion) {
        this.ccdVersion = ccdVersion;
    }

    public Date getServerTime() {
        return serverTime;
    }

    public void setServerTime(Date serverTime) {
        this.serverTime = serverTime;
    }

}
